import React from 'react'
import { NavBar } from 'react-vant';
import { useHistory } from 'react-router-dom';

//类型
interface propsTs {
    title: string
    leftText: boolean
}

export default function Myback(props: propsTs) {

    let { title, leftText } = props
    let history = useHistory()

    return (
        <div>
            <NavBar
                title={title}
                leftText={leftText ? "返回" : ''}
                leftArrow={leftText ? <span>{'<'}</span> : null}
                onClickLeft={() => {
                    history.go(-1)
                }}
            />
        </div>
    )
}
